package com.dxy.order.provider;

import com.dxy.common.pojo.Product;
import com.dxy.common.vo.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@FeignClient(value = "product-service", path = "/product")
public interface ProductServiceProvider {

    @GetMapping("/findProductById/{productId}")
    Result<Product> findProductById(@PathVariable("productId") String productId);

    @GetMapping("/reduceStock/{productId}/{num}")
    Result reduceStock(@PathVariable("productId") String productId, @PathVariable("num") int num);
}
